<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>档案注册表单</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="../../static/layui/css/layui.css" media="all">
</head>
<body>

<form id="myform" class="layui-form" lay-filter="layuiadmin-form-admin" id="layuiadmin-form-admin"
      style="padding: 20px 30px 0 0;">
    <!--姓名-->
    <div class="layui-form-item">
        <label class="layui-form-label required">姓名</label>
        <div class="layui-input-inline">
            <input type="text" name="human_name" lay-verify="required|name" placeholder="请输入姓名" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <!--员工性别-->
    <div class="layui-form-item">
        <label class="layui-form-label">性别</label>
        <div class="layui-input-inline">
            <input type="radio" name="human_sex" value="1" title="男" checked>
            <input type="radio" name="human_sex" value="2" title="女">
        </div>
    </div>
    <!--出生日期-->
    <div class="layui-form-item">
        <label class="layui-form-label">出生日期</label>
        <div class="layui-input-inline">
            <input type="text" name="human_birthday" class="layui-input" id="human_birthday"
                   placeholder="请输入出生日期">
        </div>
    </div>
    <!--受教育的程度-->
    <div class="layui-form-item">
        <label class="layui-form-label">学历</label>
        <div class="layui-input-inline">
            <select name="human_education">
                <option value="">--请选择--</option>
                <option value="高中">高中</option>
                <option value="专科">专科</option>
                <option value="本科">本科</option>
                <option value="博士">博士</option>
            </select>
        </div>
    </div>
    <!--email-->
    <div class="layui-form-item">
        <div class="layui-inline">
            <label class="layui-form-label">邮箱</label>
            <div class="layui-input-inline">
                <input type="text" name="human_email" lay-verify="required|email" autocomplete="off"
                       class="layui-input">
            </div>
        </div>
    </div>
    <!--联系方式-->
    <div class="layui-form-item">
        <label class="layui-form-label">联系电话</label>
        <div class="layui-input-inline">
            <input type="text" name="human_tel" lay-verify="required|tel" placeholder="请输入联系电话" autocomplete="off"
                   class="layui-input">
        </div>
    </div>
    <!--所在部门-->
    <div class="layui-form-item">
        <label class="layui-form-label">所在部门</label>
        <div class="layui-input-inline">
            <select name="dept_id">
                <option value="">--请选择--</option>
                <option value="1">平台研发中心</option>
                <option value="2">产品设计中心</option>
                <option value="3">系统维护中心</option>
            </select>
        </div>
    </div>
    <!--个人履历-->
    <div class="layui-form-item layui-form-text">
        <label class="layui-form-label">个人履历：</label>
        <div class="layui-input-block">
            <textarea name="human_resume" lay-verify="required|resume" placeholder="请输入内容"
                      class="layui-textarea"></textarea>
        </div>
    </div>
    <!--确认提交-->
    <div class="layui-form-item layui-hide">
        <input type="button" lay-submit lay-filter="LAY-user-front-submit" id="LAY-user-back-submit" value="确认">
    </div>
</form>

<!--引入本地layui.js-->
<script src="../../static/layui/layui.js"></script>
<script src="../../static/js/jquery-3.6.0.min.js"></script>
<!--js-->
<script type="text/javascript">
    layui.config({
        base: '../../static/layui/layuiadmin/' //静态资源所在路径js
    }).extend({
        index: 'lib/index' //主入口模块
    }).use('index');
</script>
<script>
    layui.use(['form', 'layedit', 'laydate', 'layer'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;
        //出生日期模块
        var laydate = layui.laydate;
        //常规用法
        laydate.render({
            elem: '#human_birthday'
        });

        //自定义验证规则
        form.verify({
            name: function (value) {
                if (value.length < 3) {
                    return '用户名称至少3字符';
                }
            }
            , email: [
                /^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/
                , '请填写正确的邮箱地址'
            ]
            , tel: [
                /^(13[0-9]|14[5|7]|15[0|1|2|3|5|6|7|8|9]|18[0|1|2|3|5|6|7|8|9])\d{8}$/
                , '请填写正确的手机号码'
            ]
            , content: function (value) {
                layedit.sync(editIndex);
            }
        });
    });
</script>
<!-- 注意：如果你直接复制所有代码到本地，上述 JS 路径需要改成你本地的 -->
<script>
    layui.use(['form', 'layedit', 'laydate'], function () {
        var form = layui.form
            , layer = layui.layer
            , layedit = layui.layedit
            , laydate = layui.laydate;

        //自定义验证规则
        form.verify({
            title: function (value) {
                if (value.length < 5) {
                    return '标题至少得5个字符啊';
                }
            }
            , pass: [
                /^[\S]{6,12}$/
                , '密码必须6到12位，且不能出现空格'
            ]
            , content: function (value) {
                layedit.sync(editIndex);
            }
        });


    });
</script>

</body>
</html>


</body>
</html>